/* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
   Module Name          : com.yaodian100.ec.product.entity.ProductSupplierApprove
   Module Description   :

   Date Created      : 2010/8/18
   Original Author   : feeling
   Team              : yaodian100
   ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
   MODIFICATION HISTORY
   ------------------------------------------------------------------------------
   Date Modified       Modified by       Comments
   ------------------------------------------------------------------------------
   ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
package com.yaodian100.ec.product.entity;

import java.math.BigDecimal;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlTransient;

import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

import com.yaodian100.core.common.entity.BaseEntity;

/**
 * @author feeling
 * 
 */
@Entity
@Table(name = "EC_PRODUCT_SUPPLIER_APPROVE")
public class ProductSupplierApprove extends BaseEntity {

	/**
	 * 
	 */
	private static final long serialVersionUID = -8209736499720403518L;
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO, generator = "seq_ec_productsupplier_approve")
	@SequenceGenerator(name = "seq_ec_productsupplier_approve", sequenceName = "SEQ_EC_PRODUCTSUPPLIER_APPROVE")
	@Column(name = "ID")
	private Long id;

	/**
	 * 原供應商
	 */
	@Column(name = "OLD_SUPPLIER_ID", length = 6, nullable = false)
	private String oldSupplierId;

	/**
	 * 原成本
	 */
	@Column(name = "OLD_COST", nullable = false, columnDefinition = "NUMERIC(10, 1)")
	private BigDecimal oldCost;

	/**
	 * 新供應商
	 */
	@Column(name = "NEW_SUPPLIER_ID", length = 6, nullable = false)
	private String newSupplierId;

	/**
	 * 新成本
	 */
	@Column(name = "NEW_COST", nullable = false, columnDefinition = "NUMERIC(10, 1)")
	private BigDecimal newCost;

	/**
	 * 申請人
	 */
	@Column(name = "APPLY_USER", nullable = false)
	private String applyUser;

	/**
	 * 申請日期
	 */
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "APPLY_DATE", nullable = false)
	private Date applyDate;

	/**
	 * 審核人
	 */
	@Column(name = "APPROVE_USER")
	private String approveUser;

	/**
	 * 審核日期
	 */
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "APPROVE_DATE")
	private Date approveDate;

	/**
	 * 審核狀態
	 */
	@Column(name = "APPROVE_STATUS", length = 2, nullable = false)
	private String approveStatus;

	/**
	 * 審核失敗原因
	 */
	@Column(name = "APPROVE_FAIL_REASON")
	private String approveFailReason;

	/**
	 * 商品編號
	 */
	@Column(name = "PRODUCT_ID", nullable = false, length = 8)
	private String productId;

	@XmlTransient
	@NotFound(action = NotFoundAction.IGNORE)
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "PRODUCT_ID", insertable = false, updatable = false)
	private Product product;

	/**
	 * 台湾馆供應商
	 */
	@Column(name = "NEW_TW_SUPPLIER_ID", length = 6)
	private String newTwSupplierId;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getNewSupplierId() {
		return newSupplierId;
	}

	public void setNewSupplierId(String newSupplierId) {
		this.newSupplierId = newSupplierId;
	}

	public BigDecimal getNewCost() {
		return newCost;
	}

	public void setNewCost(BigDecimal newCost) {
		this.newCost = newCost;
	}

	public String getApplyUser() {
		return applyUser;
	}

	public void setApplyUser(String applyUser) {
		this.applyUser = applyUser;
	}

	public Date getApplyDate() {
		return applyDate;
	}

	public void setApplyDate(Date applyDate) {
		this.applyDate = applyDate;
	}

	public String getApproveUser() {
		return approveUser;
	}

	public void setApproveUser(String approveUser) {
		this.approveUser = approveUser;
	}

	public Date getApproveDate() {
		return approveDate;
	}

	public void setApproveDate(Date approveDate) {
		this.approveDate = approveDate;
	}

	public String getApproveStatus() {
		return approveStatus;
	}

	public void setApproveStatus(String approveStatus) {
		this.approveStatus = approveStatus;
	}

	public String getApproveFailReason() {
		return approveFailReason;
	}

	public void setApproveFailReason(String approveFailReason) {
		this.approveFailReason = approveFailReason;
	}

	public String getProductId() {
		return productId;
	}

	public void setProductId(String productId) {
		this.productId = productId;
	}

	public String getOldSupplierId() {
		return oldSupplierId;
	}

	public void setOldSupplierId(String oldSupplierId) {
		this.oldSupplierId = oldSupplierId;
	}

	public BigDecimal getOldCost() {
		return oldCost;
	}

	public void setOldCost(BigDecimal oldCost) {
		this.oldCost = oldCost;
	}

	public Product getProduct() {
		return product;
	}

	public void setProduct(Product product) {
		this.product = product;
	}

	public String getNewTwSupplierId() {
		return newTwSupplierId;
	}

	public void setNewTwSupplierId(String newTwSupplierId) {
		this.newTwSupplierId = newTwSupplierId;
	}
}